import { ajax } from '../http.js';

const industryUrl = '/product_b2b/find_by_user_industry'; // 行业采购
const findRecommendUrl = '/product/find_page'; // 今日推荐
const hotSaleByWeekUrl = '/product_b2b/find_hot_sale_by_week'; // 本周热销
const brandFindUrl = '/brand/find'; // 品牌优选
const categoryFindUrl = '/category/find_all'; // 商品类目
const bannerFindUrl = '/banner/find_all'; // 商品banner
const productSearchUrl = '/product_b2b/search'; // 商品搜索

const industry = (data, success, fail) =>// 行业采购
  ajax({
    url: industryUrl,
    data: data,
    success: success,
    fail: fail
  });
const findRecommend = (data, success, fail) =>// 今日推荐
  ajax({
    url: findRecommendUrl,
    data: data,
    success: success,
    fail: fail
  });
const hotSaleByWeek = (data, success, fail) =>// 本周热销
  ajax({
    url: hotSaleByWeekUrl,
    data: data,
    success: success,
    fail: fail
  });
const brandFind = (data, success, fail) =>// 本周热销
  ajax({
    url: brandFindUrl,
    data: data,
    success: success,
    fail: fail
  });

const categoryFind = (data, success, fail) =>// 查询类目
  ajax({
    url: categoryFindUrl,
    data: data,
    success: success,
    fail: fail
  });
const bannerFind = (data, success, fail) =>// 商品banner
  ajax({
    url: bannerFindUrl,
    data: data,
    success: success,
    fail: fail
  });
const productSearch = (data, success, fail) =>// 商品搜索
  ajax({
    url: productSearchUrl,
    data: data,
    success: success,
    fail: fail
  });
export {
  industry, // 行业采购
  findRecommend, // 今日推荐
  hotSaleByWeek, // 本周热销
  brandFind, // 品牌优选
  categoryFind, // 查询类目
  bannerFind, // 商品banner
  productSearch // 商品搜索
}